

import numpy as np


class One2OneDistance:

    # given two points p1 and p2,
    # return the distance between them by any defintion of distance.
    # here, we use Euclidean distance

    def __call__(self, p1: np.ndarray, p2: np.ndarray):
        # calculate Eucilidean distance
        EuclideanDistance = np.sqrt(np.sum(np.square(p1-p2)))
        return EuclideanDistance

    @staticmethod
    def testOne2OneDis():
        p1 = np.array([1, 2, 3])
        p2 = np.array([4, 5, 6])
        d = One2OneDistance()

        dis = d(p1, p2)
        print(dis)


if __name__ =='__main__':

    t = One2OneDistance()
    t.testOne2OneDis()